﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;

namespace THenu.TinyHourseLib.DesignPattern.Factory_Method
{
    public abstract class AbsLog
    {
        public abstract void WriteLog();
    }
    public abstract class LogFactory
    {
        public abstract AbsLog CreateLog();
    }
    public class FileLog : AbsLog
    {
        public override void WriteLog()
        {
            Console.WriteLine("File Log Write.");
        }
    }
    public class FileFactory : LogFactory
    {
        public override AbsLog CreateLog()
        {
            return new FileLog();
        }
    }
    public class EventLog : AbsLog
    {
        public override void WriteLog()
        {
            Console.WriteLine("Event Log Write.");
        }
    }

    public class EventFactory : LogFactory
    {
        public override AbsLog CreateLog()
        {
            return new EventLog();
        }
    }

}
